package com.sjm.suchbear.minibookmall;

import android.app.Activity;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.sjm.suchbear.minibookmall.action.NoticeManage;
import com.sjm.suchbear.minibookmall.model.NoticeModel;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class NoticeDetailActivity extends Activity {

    @BindView(R.id.ll_header_back)
    LinearLayout llHeaderBack;
    @BindView(R.id.tv_list_title)
    TextView tvListTitle;
    @BindView(R.id.iv_header_function_ico)
    ImageView ivHeaderFunctionIco;
    @BindView(R.id.ll_header_function)
    LinearLayout llHeaderFunction;
    @BindView(R.id.ll_List_Main)
    RelativeLayout llListMain;
    @BindView(R.id.tv_noticeTitle)
    TextView tvNoticeTitle;
    @BindView(R.id.tv_noticeContent)
    TextView tvNoticeContent;

    private SQLiteDatabase dbread;
    private NoticeModel noticeModel;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_notice_detail);
        ButterKnife.bind(this);
        BookDB db = new BookDB(getBaseContext());
        dbread = db.getReadableDatabase();
        noticeModel = (NoticeModel) getIntent().getExtras().getSerializable("noticemodel");
    }

    @Override
    protected void onResume() {
        super.onResume();
        tvListTitle.setText("公告详情");
        tvNoticeTitle.setText("标题: ".concat(noticeModel.getNoticetitle()));
        tvNoticeContent.setText(noticeModel.getNoticecontent());
    }

    @OnClick(R.id.ll_header_back)
    public void onViewClicked() {
        finish();
    }
}
